﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class DodajSlub : Form
    {Form2 F;
        public DodajSlub(Form2 F)
        {
            this.F = F;
            InitializeComponent();
        }

        private void DodajSlub_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            string wyn = "insert into sluby (Rok, Numer, Narzeczony, Narzeczona, Data_Ślubu, Pierwszy_Świadek, Drugi_Świadek, ks) ";
            wyn += " values ( ";
            wyn += textBox1.Text + ", ";
            wyn += textBox2.Text + ", ";
            wyn += textBox3.Text + ", ";
            wyn += textBox4.Text + ", ";
            wyn += "\'"+textBox5.Text + "\', ";
            wyn += textBox6.Text + ", ";
            wyn += textBox7.Text + ", ";
            wyn += textBox8.Text + "); ";
            BazaDaych.Wykonaj(wyn);
            F.pokazwszystko();
            this.Close();
        }
    }
}
